import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '@/components/Home';
import Login from "@/components/Login";
import Register from "@/components/Register";
import Content from "@/components/Content";
import CameraManagement from "@/components/CameraManagement";
import UserList from "@/components/UserList";
import UserInfo from "@/components/UserInfo";
import ElderManagement from "@/components/ElderManagement";
import WorkerManagement from "@/components/WorkerManagement";
import VolunteerManagement from "@/components/VolunteerManagement";
import DataManagement from "@/components/DataManagement";
import ElderAnalysis from "@/components/ElderAnalysis";
import WorkerAnalysis from "@/components/WorkerAnalysis";
import VolunteerAnalysis from "@/components/VolunteerAnalysis";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Index',
        component: UserList
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/register',
        name: 'Register',
        component: Register
    },
    {
        path: '/content',
        name: 'Content',
        component: Content,
        meta:{requireAuth:true}
    },
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/cameraManagement',
        name: 'CameraManagement',
        component: CameraManagement
    },
    {
        path: '/userList',
        name: 'UserList',
        component: UserList
    },
    {
        path: '/userInfo',
        name: 'UserInfo',
        component: UserInfo
    },
    {
        path: '/elderManagement',
        name: 'ElderManagement',
        component: ElderManagement
    },
    {
        path: '/workerManagement',
        name: 'WorkerManagement',
        component: WorkerManagement
    },
    {
        path: '/volunteerManagement',
        name: 'VolunteerManagement',
        component: VolunteerManagement
    },
    {
        path: '/dataManagement',
        name: 'DataManagement',
        component: DataManagement
    },
    {
        path: '/elderAnalysis',
        name: 'ElderAnalysis',
        component: ElderAnalysis
    },
    {
        path: '/workerAnalysis',
        name: 'WorkerAnalysis',
        component: WorkerAnalysis
    },
    {
        path: '/volunteerAnalysis',
        name: 'VolunteerAnalysis',
        component: VolunteerAnalysis
    }

];

const router = new VueRouter({
    mode: 'history',
    // base: process.env.BASE_URL,
    routes: routes
})



export default router
